home *** CD-ROM | disk | FTP | other *** search
/ Amiga Magazin: Amiga-CD 1997 November & December / Amiga-CD 1997 #11-12.iso / pd-disketten / ungepackt / 12_95 / apd-12-95-4-2 / v42printer / v42printerinstall < prev    next >
Text File  |  1996-01-25  |  11KB  |  354 lines

  1. ; $VER: V42PrinterInstall 42.3 (31.1.95)
  2. ; Script to install V42 printer.device
  3.  
  4. ;===============================================================
  5. ; Set up text strings
  6. ;===============================================================
  7.  
  8. (set #introduction
  9.     (cat "\n\nThis program lets you install V42 of the printer.device "
  10.          "onto a hard drive.\nV42 of the printer.device provides "
  11.          "multi-threaded multi-printer support, printer management, "
  12.          "and printing to files.\n\n"
  13.          "Please refer to the documentation and software for "
  14.          "distribution and copyright information."))
  15.  
  16. (set #ask-old
  17.     (cat "Do you wish to save the V3x printer files?"))
  18.  
  19. (set #ask-old-help
  20.     (cat "Answering YES will make the install save the old printer "
  21.          "related files to a specified directory.  Otherwise, the files "
  22.          "will be deleted.\n\n"))
  23.  
  24. (set #where-old
  25.     (cat "In which directory should the OLD printer files be placed?"))
  26.  
  27. (set #where-old-help
  28.     (cat "This section lets you choose on which hard drive directory the "
  29.          "old printer.device related files should go.\n\n"
  30.          @askdir-help))
  31.  
  32. (set #where-device
  33.     (cat "In which directory should the V42 printer.device be installed?"))
  34.  
  35. (set #where-device-help
  36.     (cat "This section lets you choose on which hard drive directory the "
  37.          "V42 printer.device will be installed.  This should normally go "
  38.          "to the same directory as the V3x printer.device.\n\n"
  39.          @askdir-help))
  40.  
  41. (set #where-handler
  42.     (cat "In which directory should the V42 printer-handler be installed?"))
  43.  
  44. (set #where-handler-help
  45.     (cat "This section lets you choose on which hard drive directory the "
  46.          "V42 printer-handler will be installed.  This should normally go "
  47.          "to the same directory as the V3x dos handlers.\n\n"
  48.          @askdir-help))
  49.  
  50. (set #where-dosdriver
  51.     (cat "In which directory should the V42 PRT: mountlist be installed?"))
  52.  
  53. (set #where-dosdriver-help
  54.     (cat "This section lets you choose on which hard drive directory the "
  55.          "V42 PRT: mountlist will be installed.  This should normally go "
  56.          "to the same directory as the V3x mountlists.\n\n"
  57.          @askdir-help))
  58.  
  59. (set #where-prefs
  60.     (cat "In which directory should the V42 Printer prefs be installed?"))
  61.  
  62. (set #where-prefs-help
  63.     (cat "This section lets you choose on which hard drive directory the "
  64.          "V42 Printer prefs will be installed.  This should normally go "
  65.          "to the same directory as the V3x preferences programs.\n\n"
  66.          @askdir-help))
  67.  
  68. (set #where-prtmgr
  69.     (cat "In which directory should the V42 Printer Manager be installed?"))
  70.  
  71. (set #where-prtmgr-help
  72.     (cat "This section lets you choose on which hard drive directory the "
  73.          "V42 Printer Manager will be installed.\n\n"
  74.          @askdir-help))
  75.  
  76. (set #ask-postscript
  77.     (cat "Do you wish to patch to PostScript driver to allow multiple "
  78.          "postscript printers?"))
  79.  
  80. (set #ask-postscript-help
  81.     (cat "Answering YES will make the install patch the PostScript "
  82.          "driver.  Version 39.1 of the driver is required.\n\n"))
  83.  
  84. (set #where-postscript
  85.     (cat "In which directory should the V42 PostScript driver be installed?"))
  86.  
  87. (set #where-postscript-help
  88.     (cat "This section lets you choose on which hard drive directory the "
  89.          "V42 PostScript driver will be installed.  This should normally go "
  90.          "to the same directory as the V3x printer drivers.\n\n"
  91.          @askdir-help))
  92.  
  93. (set #where-v39postscript
  94.     (cat "Please locate the V39.1 PostScript driver."))
  95.  
  96. (set #where-v39postscript-help
  97.     (cat "The V39.1 PostScript driver is required for the V42.1 patch.\n\n"
  98.          @askdir-help))
  99.  
  100. (set #which-ports
  101.     (cat "Which printer ports do you wish to have installed?"))
  102.  
  103. (set #ask-prt
  104.     (cat "In order to use the new PRT: handler, "
  105.          "the following commands are needed.  "
  106.          "Do you want them added to your startup?\n\n"
  107.          "assign PRT: dismount\nmount PRT:\n\n"
  108.          "NOTE: PRT: will not be mounted until you reboot."))
  109.  
  110. (set #ask-prt-help
  111.     (cat "The listed commands are required to dismount the old PRT: and "
  112.          "mount the new PRT: using the installed mountlist.  "
  113.          "If you request it, the installer will add the necessary commands "
  114.          "to your user-startup script, which is run when your machine boots.  "
  115.          "If you decide not to allow the installer to make these changes, "
  116.          "you will need to make them yourself."))
  117.  
  118. ;===============================================================
  119. ; Introduction
  120. ;===============================================================
  121.  
  122. (complete 0)
  123. (message #introduction)
  124. (set old-level @user-level)
  125.  
  126. ;===============================================================
  127. ; Get information from the user
  128. ;===============================================================
  129.  
  130. (set yn-saveold (askbool (prompt #ask-old)
  131.     (help #ask-old-help)
  132.     (default 1)))
  133.  
  134. (if (= yn-saveold 1)
  135. (
  136.    (set target-old (askdir (prompt #where-old)
  137.        (help @askdir-help)
  138.        (default "SYS:Old")
  139.        (disk)))
  140. ))
  141.  
  142. (set target-device (askdir (prompt #where-device)
  143.     (help #where-device-help)
  144.     (default "DEVS:")
  145.     (disk)))
  146.  
  147. (set yn-postscript (askbool (prompt #ask-postscript)
  148.     (help #ask-postscript-help)
  149.     (default 1)))
  150.  
  151. (if (= yn-postscript 1)
  152. (
  153.    (set target-postscript (askdir (prompt #where-postscript)
  154.        (help #where-postscript-help)
  155.        (default "PRINTERS:")
  156.        (disk)))
  157. ))
  158.  
  159. (set target-handler (askdir (prompt #where-handler)
  160.     (help #where-handler-help)
  161.     (default "L:")
  162.     (disk)))
  163.  
  164. (set target-dosdriver (askdir (prompt #where-dosdriver)
  165.     (help #where-dosdriver-help)
  166.     (default "DEVS:DosDrivers")
  167.     (disk)))
  168.  
  169. (set target-prefs (askdir (prompt #where-prefs)
  170.     (help #where-prefs-help)
  171.     (default "SYS:Prefs")
  172.     (disk)))
  173.  
  174. (set target-prtmgr (askdir (prompt #where-prtmgr)
  175.     (help #where-prtmgr-help)
  176.     (default "SYS:System")
  177.     (disk)))
  178.  
  179. (set list-ports (askoptions (prompt #which-ports)
  180.     (choices "Amiga Internal Parallel"
  181.              "Amiga Internal Serial"
  182.              "Print to File"
  183.              "No Output Device"
  184.              "Envoy")
  185.     (help)))
  186.  
  187. (set @default-dest "RAM:")
  188.  
  189. ;===============================================================
  190. ; Save the old files if requested
  191. ;===============================================================
  192.  
  193. (if (= yn-saveold 1)
  194. (
  195.    (if (exists (tackon target-device "printer.device"))
  196.    (
  197.        (set result (run (cat "Version " (tackon target-device "printer.device")
  198.                              " FILE VERSION 42")))
  199.        (if (> result 0)
  200.        (
  201.            (copyfiles (source (tackon target-device "printer.device")) (dest target-old))
  202.        ))
  203.    ))
  204.    (complete 4)
  205.  
  206.    (if (exists (tackon target-prefs "Printer"))
  207.    (
  208.        (set result (run (cat "Version " (tackon target-prefs "Printer")
  209.                              " FILE VERSION 42")))
  210.        (if (> result 0)
  211.        (
  212.            (copyfiles (source (tackon target-prefs "Printer")) (dest target-old))
  213.            (complete 8)
  214.  
  215.            (if (exists (tackon target-prefs "Printer.info"))
  216.            (
  217.                (copyfiles (source (tackon target-prefs "Printer.info")) (dest target-old))
  218.            ))
  219.            (complete 12)
  220.  
  221.            (if (exists (tackon target-prefs "PrinterGfx"))
  222.            (
  223.                (copyfiles (source (tackon target-prefs "PrinterGfx")) (dest target-old))
  224.            ))
  225.            (complete 16)
  226.  
  227.            (if (exists (tackon target-prefs "PrinterGfx.info"))
  228.            (
  229.                (copyfiles (source (tackon target-prefs "PrinterGfx.info")) (dest target-old))
  230.            ))
  231.        ))
  232.    ))
  233. ))
  234. (complete 20)
  235.  
  236. ;===============================================================
  237. ; Delete the V39 files
  238. ;===============================================================
  239.  
  240. (if (exists (tackon target-device "printer.device"))
  241. (
  242.     (delete (tackon target-device "printer.device"))
  243. ))
  244. (complete 24)
  245.  
  246. (if (exists (tackon target-prefs "Printer"))
  247. (
  248.     (delete (tackon target-prefs "Printer"))
  249. ))
  250. (complete 28)
  251.  
  252. (if (exists (tackon target-prefs "Printer.info"))
  253. (
  254.     (delete (tackon target-prefs "Printer.info"))
  255. ))
  256. (complete 32)
  257.  
  258. (if (exists (tackon target-prefs "PrinterGfx"))
  259. (
  260.     (delete (tackon target-prefs "PrinterGfx"))
  261. ))
  262. (complete 36)
  263.  
  264. (if (exists (tackon target-prefs "PrinterGfx.info"))
  265. (
  266.     (delete (tackon target-prefs "PrinterGfx.info"))
  267. ))
  268. (complete 40)
  269.  
  270. ;===============================================================
  271. ; Install the V42 files
  272. ;===============================================================
  273.  
  274. (copyfiles (source "printer.device") (dest target-device))
  275. (complete 44)
  276.  
  277. (if (= yn-postscript 1)
  278. (
  279.    (user 2)
  280.    (set file-v39postscript (askfile (prompt #where-v39postscript)
  281.                     (help #where-v39postscript-help)
  282.                     (default "PRINTERS:PostScript")))
  283.    (user old-level)
  284.    (set result (run (cat "patches/SPatch -o"  (tackon target-postscript "PostScript")
  285.                          " -ppatches/PostScript.pch " file-v39postscript)))
  286.    (if (> result 0)
  287.    (
  288.        (abort)
  289.    ))
  290. ))
  291. (complete 48)
  292.  
  293. (copyfiles (source "printer-handler") (dest target-handler))
  294. (complete 52)
  295.  
  296. (copyfiles (source "PRT") (dest target-dosdriver))
  297. (complete 58)
  298.  
  299. (copyfiles (source "Printer") (dest target-prefs))
  300. (complete 60)
  301.  
  302. (copyfiles (source "Printer.info") (dest target-prefs))
  303. (complete 64)
  304.  
  305. (copyfiles (source "PrtMgr") (dest target-prtmgr))
  306. (complete 68)
  307.  
  308. (copyfiles (source "PrtMgr.info") (dest target-prtmgr))
  309. (complete 72)
  310.  
  311. (if (not (exists (tackon target-device "PrinterPorts")))
  312. (
  313.    (makedir (tackon target-device "PrinterPorts") (infos))
  314. ))
  315. (complete 76)
  316.  
  317. (if (in list-ports 0)
  318. (
  319.    (copyfiles (source "PrinterPorts/Parallel 0.info") (dest (tackon target-device "PrinterPorts")))
  320. ))
  321. (complete 80)
  322.  
  323. (if (in list-ports 1)
  324. (
  325.    (copyfiles (source "PrinterPorts/Serial 0.info") (dest (tackon target-device "PrinterPorts")))
  326. ))
  327. (complete 84)
  328.  
  329. (if (in list-ports 2)
  330. (
  331.    (copyfiles (source "PrinterPorts/File.info") (dest (tackon target-device "PrinterPorts")))
  332. ))
  333. (complete 88)
  334.  
  335. (if (in list-ports 3)
  336. (
  337.    (copyfiles (source "PrinterPorts/No Port.info") (dest (tackon target-device "PrinterPorts")))
  338. ))
  339. (complete 92)
  340.  
  341. (if (in list-ports 4)
  342. (
  343.    (copyfiles (source "PrinterPorts/Envoy.info") (dest (tackon target-device "PrinterPorts")))
  344. ))
  345. (complete 96)
  346.  
  347. ;===============================================================
  348. ; Modify the User-Startup to mount PRT:
  349. ;===============================================================
  350.  
  351. (startup "V42 printer.device" (prompt #ask-prt)
  352.         (command "assign PRT: dismount\nmount PRT:\n")
  353.         (help #ask-prt-help))
  354. (complete 100)